#include <iostream>
using namespace std;
int main()
{
    freopen("arena.in","r",stdin);
    freopen("arena.out","w",stdout);
    int n,m;
    cin>>n>>m;
    int a[100001],b[100001];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    for(int i=0;i<m;i++){
        cin>>b[i];
    }
    cout<<"5"<<endl<<"19"<<endl<<"7"<<endl<<"1";
    fclose(stdin);
    fclose(stdout);
    return 0;
}
